/*
 * @Author: your name
 * @Date: 2020-10-26 10:42:21
 * @LastEditTime: 2020-10-29 15:29:25
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /Project/DemoNodeProject/src/Actions/OrderActions.js
 */
import {commonAction} from './UserActions'

/**
 * @description: 下单接口
 * @param {type} 
 * @return: 
 */
export const createOrder = (parameter) => (dispatch) => dispatch(commonAction('api/createOrder',parameter,null,false))

/**
 * @description: 获取订单列表
 * @param {type} 
 * @return: 
 */
export const orderList = (parameter) => (dispatch) => dispatch(commonAction('api/orderList',parameter,null,false))

/**
 * @description: 模拟订单支付成功
 * @param {type} 
 * @return: 
 */
export const orderPayStatus = (parameter) => (dispatch) => dispatch(commonAction('api/orderPayStatus',parameter,null,false))


/**
 * @description: 商家确认接单
 * @param {type} 
 * @return: 
 */
export const acceptOrder = (parameter) => (dispatch) => dispatch(commonAction('api/confirmOrder',parameter,null,false, 'other'))

/**
 * @description: 骑手抢单
 * @param {type} 
 * @return: 
 */
export const robOrder = (parameter) => (dispatch) => dispatch(commonAction('api/robOrder',parameter,null,false,'help'))

/**
 * @description: 骑手在商家领餐
 * @param {type} 
 * @return: 
 */
export const getOrderFood = (parameter) => (dispatch) => dispatch(commonAction('api/getOrderFood',parameter,null,false,'one'))
/**
 * @description: 确认完成配送
 * @param {type} 
 * @return: 
 */
export const finishOrder = (parameter) => (dispatch) => dispatch(commonAction('api/finishOrder',parameter,null,false, 'two'))